package com.example.demo.Service;

import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: H_tao_X
 * Date: 2022-11-25
 * Time: 15:27
 */
@Controller // 与前端交互的注解
@ResponseBody
@Slf4j // 利用注解获取日志对象，默认生成 log 对象
public class UserService {
    @RequestMapping("/hh")
    public void sayHi() {
        log.trace("trace: 微量日志");
        log.debug("debug：调试日志");
        log.info("info: 普通日志");
        log.warn("warn: 警告日志");
        log.error("error: 错误日志");

    }
}
